import service from "../../utils/request.ts";

/**
 * 分页查询本人的题库
 * @param data 分页参数
 * @returns {*}
 */
export const pageBank=(data)=>{
    return   service({
        url: "/bank/page",
        method: 'post',
        data: data
    })
}

export const addBank=(data)=>{
    return   service({
        url: "/bank/add",
        method: 'post',
        data: data
    })
}
export const deleteBank=(id)=>{
    return   service({
        url: `/bank/delete/${id}`,
        method: 'delete',
        data: null
    })
}
export const getBankInfoById=(id)=>{
    return   service({
        url: `/bank/get/${id}`,
        method: 'get',
        data: null
    })
}

export const updateBank=(data)=>{
    return   service({
        url: `/bank/update`,
        method: 'put',
        data: data
    })
}
export const getBankList=()=>{
    return   service({
        url: `/bank/list`,
        method: 'get',
        data: null
    })
}

export const getShareList=()=>{
    return   service({
        url: `/bank/list/share`,
        method: 'get',
        data: null
    })
}
export const getPracticeBank=(data)=>{
    return   service({
        url: `/bank/pagePractice`,
        method: 'post',
        data: data
    })
}
export const initBankQustionList=(id)=>{
    return   service({
        url: `/bank/list/practice/${id}`,
        method: 'get',
        data: null
    })
}
export const checkPracticeResult=(data)=>{
    return   service({
        url: `/bank/practice/correct`,
        method: 'post',
        data: data
    })
}
